<nav class="navbar navbar-default">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#duigou-navvar-collapse" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{$Think.config.web_url}"><img src="__PUBLIC__/tpl2/images/logo.png"></a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="duigou-navvar-collapse">
            <div class="duigou-location">
                <i class="fa fa-map-marker"></i> <span id="location">全国</span><br>
                <a class="location-hover" href="javascript:void(0);">切换城市</a>
            </div>
            <ul class="nav navbar-nav">
                <li class="active"><a href="http://www.duigoujob.com/">首页 <span class="sr-only">(current)</span></a>
                </li>
                <li><a href="http://www.duigoujob.com/jobs/">找兼职</a></li>
                <!--<li><a href="/companys/">公司</a></li>-->
                <!--<li  ><a href="/Home/Job/publish">免费发布兼职</a></li>-->
                <li><a href="http://www.duigoujob.com/topic/list_1.html" title="兼职公告资讯,兼职宝典等">研究院</a></li>
                <li><a href="http://www.duigoujob.com/Home/Job/publish" title="免费发布兼职岗位">免费发布兼职</a></li>
            </ul>
            <!--<form class="navbar-form navbar-left" role="search">-->
            <!--<div class="form-group">-->
            <!--<input type="text" class="form-control" placeholder="Search">-->
            <!--</div>-->
            <!--<button type="submit" class="btn btn-default">Submit</button>-->
            <!--</form>-->
            <notempty name="user_info">
                <ul class="nav navbar-nav navbar-right">
                    <!--<li><a href="#" class="nav-msg"><i class="fa fa-envelope-o"></i></a></li>-->
                    <li class="dropdown open">
                        <a aria-expanded="true" aria-haspopup="true" role="button" data-toggle="dropdown"
                           class="dropdown-toggle duigou-user-dropdown" href="#">{$user_info.mobile|strReplceOther=3,7} <span
                                class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="/Business/Manage/online">兼职管理</a></li>
                            <li class="divider" role="separator"></li>

                            <li><a href="/addons.php?m=duigou_leader&amp;c=manage&amp;a=business">领队管理</a></li>
                            <li class="divider" role="separator"></li>
                            <!--<li><a href="/Business/Manage/online">已发布兼职</a></li>-->
                            <!--<li role="separator" class="divider"></li>-->
                            <li><a href="{:U('/Home/company')}">公司主页</a></li>
                            <li class="divider" role="separator"></li>
                            <li><a href="/Business/Manage/auth/t/business">身份认证</a></li>
                            <li class="divider" role="separator"></li>
                            <li><a href="/UCenter/Set/bind">帐号设置</a></li>
                            <li class="divider" role="separator"></li>
                            <li><a href="{:U('/Home/logout')}">退出登录</a></li>
                        </ul>
                    </li>
                </ul>
                <else/>

                <ul class="nav navbar-nav navbar-right">
                    <li><a href="{:('/home/login')}" class="nav-reg nav-login">登录</a></li>
                    <li><a href="{:('/home/choose')}" class="nav-reg">注册</a></li>
                </ul>
            </notempty>

        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<!--<script src="//meiqia.com/js/mechat.js?unitid=55e270264eae35ca79000001" charset="UTF-8" async="async"></script>-->

<script>
    $(function () {
        var geolocation = new BMap.Geolocation();
        geolocation.getCurrentPosition(function (r) {
            if (this.getStatus() == BMAP_STATUS_SUCCESS) {
                var myGeo = new BMap.Geocoder();
                myGeo.getLocation(new BMap.Point(r.point.lng, r.point.lat), function (rs) {
                    console.log(rs.addressComponents.city);
                    $.getJSON('/Home/Index/autoGetCity', {city: rs.addressComponents.city}, function (data) {
                        if (data.status) {
                            layer.confirm('对勾网自动识别你所在城市为：[' + data.data.name + "]，是否切换", {
                                btn: ['是', '否'] //按钮
                            }, function () {
                                window.location = '/Home/Index/setCity/city/' + data.data.id;
                            }, function () {
                                layer.closeAll();
                            });
                        }
                    });
                });
            } else {
                alert('未知地址（' + this.getStatus() + '）');
            }
        });
//        $.getJSON('/Home/Index/autoGetCity',function(data){
//            if(data.status){
//                layer.confirm('对勾网自动识别你所在城市为：['+data.data.name+"]，是否切换", {
//                    btn: ['是','否'] //按钮
//                }, function(){
//                     window.location='/Home/Index/setCity/city/'+data.data.id;
//                }, function(){
//                    layer.closeAll();
//                });
//            }
//        });
    });
</script>
<!--head end-->